package com.changgou.search.listener;

import com.changgou.search.service.ESManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class GoodsDelListener {
    @Autowired
    private ESManagerService esManagerService;

    //接收到传过来的spuid
    //添加RabbitListener注解
    @RabbitListener(queues = "search_del_queue")
    public void recevieMessage(String spuId){
        System.out.println("删除索引接收到的spuId:" + spuId);

        //调用业务层方法,完成业务删除
        esManagerService.delDataBySpuId(spuId);
    }
}
